<? include ("../init.php") ?>
<? include ("../header.php") ?>
<? include ("../menu.php") ?>
<? include ("submenu.php") ?>

<script language = "javascript">

$(document).ready(function() {
  $("#lang-btn a").fancybox({
      'modal' : true,
      'padding' :0
  });
})
</script>

<div id = "body">

<h1><?_l('localization')?></h1>

<span id = "lang-btn"><a href = "#lang-popup" class = "add"><img src = "<?=ADMIN?>/images/icon-add.png">&nbsp;&nbsp;&nbsp;<?_l('language')?></a></span>

<div class = "page">
</div>

<div class = "clear"></div>

<form action = "save.php" method = "post" class = "form">
<table cellpadding = "0" cellspacing = "0" border = "0" class ="list">
  <th scope="col" width = "150px"><?_l($_SESSION['language'])?></th>
  <th scope="col"><?_l('display')?></th>
  <th scope="col" width = "50px"><?_l('delete')?></th>
<?
  foreach($local->words as $i => $word){
    if($i!= "" && $word != ""){
?>
    <tr>
      <td><input type = "text" value = "<?=$i?>" name = "en[]" class = "none"></td>
      <td><textarea name = "th[]" class = "none mceNoEditor"><?=$word?></textarea></td>
      <td><a href = "del.php?word=<?=$i?>" class = "btn"><?_l('delete')?></a></td>
    </tr>
<?
    }
  }

?>
  <tr><td><input type = "submit" value = "<?=__l('submit')?>" class = "btn"></td></tr>
</table>

</form>
</div>

  <div id = "page">
    <div id = "lang-popup">
      <div class = "popup">
        <form method="post" action="add.php" class = "form">
          <div class = "field"><label><?_l('word')?></label><input type = "text" name = "word" class = "input size1"></div>
          <div class = "field"><label><?_l('display')?></label><textarea name = "display" class = "input size1 mceNoEditor"></textarea></div>
          <hr>
          <div class = "field"><label></label><input type = "submit" class = "btn" value = "<?=__l('add')?>">&nbsp;<a href = "#" class = "btn" onclick="$.fancybox.close();"><?_l('cancel')?></a></div>
        </form>
      </div>
    </div>
  </div>

<script type="text/javascript">/*<![CDATA[*/(function(a){a.fn.autoResize=function(j){var b=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},j);this.filter('textarea').each(function(){var c=a(this).css({resize:'none','overflow-y':'hidden'}),k=c.height(),f=(function(){var l=['height','width','lineHeight','textDecoration','letterSpacing'],h={};a.each(l,function(d,e){h[e]=c.css(e)});return c.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(h).insertBefore(c)})(),i=null,g=function(){f.height(0).val(a(this).val()).scrollTop(10000);var d=Math.max(f.scrollTop(),k)+b.extraSpace,e=a(this).add(f);if(i===d){return}i=d;if(d>=b.limit){a(this).css('overflow-y','');return}b.onResize.call(this);b.animate&&c.css('display')==='block'?e.stop().animate({height:d},b.animateDuration,b.animateCallback):e.height(d)};c.unbind('.dynSiz').bind('keyup.dynSiz',g).bind('keydown.dynSiz',g).bind('change.dynSiz',g)});return this}})(jQuery);

$('.mceNoEditor').autoResize();/*]]>*/</script>

<style>
  .form .none{
    background:none;
    border:none;
    color:#fff;
  }

  .popup .form label{
    width:80px;
  }

  #page #lang-popup{
    position:relative;
    display:none;
  }

  #lang-popup{
    width:440px;
    height:200px;
    background: url("../images/bg.jpg") 50% 50%;
    color: #fff;
  }
</style>

<? include "../footer.php" ?>